<html lang="en" xmlns:th="http://www.springframework.org/schema/data/jaxb">



<div class="layui-row">
    <form class="layui-form" id="create_form" style="margin: 20px" lay-filter="create_form">
        <input type="hidden"  th:value="${obj.id}" id="id" name="id">
        <div class="layui-form-item">
            <label class="layui-form-label">选择要生成的模块</label>
            <div class="layui-input-block">
                <input type="checkbox"  name="create" value="entity" title="entity">
                <input type="checkbox"  name="create" value="mapper" title="mapper" >
                <input type="checkbox" name="create" value="service" title="service">
                <input type="checkbox" name="create" value="controller" title="controller">
                <input type="checkbox" name="create" value="vue" title="vue">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="">生成代码</button>
            </div>
        </div>


    </form>

</div>

<script th:inline="javascript" >

    var field_form = layui.form;
    field_form.render(null, 'create_form');
    field_form.on('submit(create_form)',function(){
        var url = /*[[@{/create}]]*/
        var  create="";
        $('input:checkbox:checked').each(function(index, element) {
               create+=element.value+",";
        });
        window.location.href=url+"?id="+$("#id").val()+"&create="+create;
        /*  $.ajax({
              url : url,
              type : "POST",
              async : false,
              dataType : "json",
              data : $("#create_form").serialize(),
              success : function(data) {
                  if(data.code==0){
                      layer.msg(data.msg, {icon: 1});
                      layer.close(create_index);
                  }else{
                      layer.msg(data.msg, {icon: 5});
                  }
              }
          });*/
        return false;
    })


</script>